<?php

use yii\helpers\Html;
use eric\widgets\ActiveForm;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Content */
/* @var $form eric\widgets\ActiveForm */
?>
<div class="content-form">

    <?php $form = ActiveForm::begin([
        'ajaxSubmitSuccess' => "function(data){\$('#content_modal').modal('hide');\$.pjax.reload('#content_grid_pjax');}",
        'options' => [
            'id' => 'content_form',
            'class' => 'form-horizontal form-bordered',
        ]
    ]); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => 512]) ?>

    <?= $form->field($model, 'thumb')->widget(\eric\widgets\FileUpload::className()) ?>

    <?= $form->field($model, 'summary')->textarea(['rows' => 6]) ?>

    <?= $form->field($model, 'detail')->widget(eric\widgets\editor\Editor::className()) ?>

    <?= $form->field($model, 'copyfrom')->textInput(['maxlength' => 128]) ?>

    <?= $form->field($model, 'rel_time')->widget(DatePicker::className(),[
                                                                            'pluginOptions'=>[
                                                                                'autoclose'=>true,
                                                                                'todayHighlight'=>true,
                                                                                'format'=>'yyyy-mm-dd',
                                                                                'clearBtn'=>true,
                                                                            ],

                                                                        ]) ?>
    <?= $form->field($model, 'channel_id',['labelOptions'=>['label'=>'发布到',]])->checkboxList($model->getChannel()) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', '添加') : Yii::t('app', '修改'), ['class' => $model->isNewRecord ? 'btn btn-support1' : 'btn btn-support3']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
